package bean;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Objects;

public class Commodity {
    private Integer id;
    private String description;
    private String imgpath;
    private Integer sort;
    private Integer quantitiy;
    private LocalDateTime createtime;
    private String creator;
    private BigDecimal price;

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getImgpath() {
        return imgpath;
    }

    public void setImgpath(String imgpath) {
        this.imgpath = imgpath;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Integer getQuantitiy() {
        return quantitiy;
    }

    public void setQuantitiy(Integer quantitiy) {
        this.quantitiy = quantitiy;
    }

    public LocalDateTime getCreatetime() {
        return createtime;
    }

    public void setCreatetime(LocalDateTime createtime) {
        this.createtime = createtime;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }


    @Override
    public String toString() {
        return "Commodity{" +
                "id=" + id +
                ", description='" + description + '\'' +
                ", imgpath='" + imgpath + '\'' +
                ", sort=" + sort +
                ", quantitiy=" + quantitiy +
                ", createtime=" + createtime +
                ", creator='" + creator + '\'' +
                ", price=" + price +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Commodity commodity = (Commodity) o;
        return Objects.equals(id, commodity.id) && Objects.equals(description, commodity.description) && Objects.equals(imgpath, commodity.imgpath) && Objects.equals(sort, commodity.sort) && Objects.equals(quantitiy, commodity.quantitiy) && Objects.equals(createtime, commodity.createtime) && Objects.equals(creator, commodity.creator);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, description, imgpath, sort, quantitiy, createtime, creator);
    }
}
